import 'package:enterprise_v6_app/app/components/custom_app_bar.dart';
import 'package:enterprise_v6_app/app/core/core.dart';
import 'package:enterprise_v6_app/app/modules/task/task_all/task_closure/task_appointment_review/common_approval_list/common_approval_list_view.dart';
import 'package:enterprise_v6_app/app/modules/task/task_all/task_closure/task_appointment_review/task_appointment_review_controller.dart';

/// 我的任务-预约审核页面
class TaskAppointmentReviewPage extends StatelessWidget {
  TaskAppointmentReviewPage({super.key});

  final controller = Get.put(TaskAppointmentReviewController());

  @override
  Widget build(BuildContext context) {
    return GetBuilder(
      init: controller,
      builder: (_) {
        return Scaffold(
          appBar: CustomAppBar(titleText: '预约审核'),
          body: DefaultTabController(
            length: 3,
            child: Column(
              children: [
                Container(
                  padding: EdgeInsets.symmetric(horizontal: 6.w),
                  decoration: BoxDecoration(
                    color: Colors.white,
                    borderRadius: BorderRadius.circular(8),
                  ),
                  height: AppDimens.dp54,
                  child: TabBar(
                    // isScrollable: true,
                    tabs: const [
                      Tab(text: '人员审核'),
                      Tab(text: '普通车辆审核'),
                      Tab(text: '危化车辆审核'),
                    ],
                    dividerColor: Colors.transparent,
                    labelPadding: EdgeInsets.only(bottom: 10.w, left: 6.w, right: 6.w),
                    labelStyle: TextStyle(
                      fontSize: 16.sp,
                      fontWeight: FontWeight.w500,
                    ),
                    unselectedLabelStyle: TextStyle(
                      fontSize: 16.sp,
                      fontWeight: FontWeight.w500,
                    ),
                    labelColor: Colors.black,
                    unselectedLabelColor: const Color(0xffA0A7B5),
                    indicatorPadding: EdgeInsets.only(top: 36.w, bottom: 10.w),
                    indicator: const BoxDecoration(
                      image: DecorationImage(
                        image: AssetImage(
                          AppImages.icon_app_work_plan,
                        ),
                      ),
                    ),
                  ),
                ),
                Expanded(
                    child: Container(
                  color: const Color(0xffF5F5F6),
                  child: TabBarView(
                    children: [
                      CommonApprovalListPage(type: 0, globalKey: controller.globalKey1),
                      CommonApprovalListPage(type: 1, globalKey: controller.globalKey2),
                      CommonApprovalListPage(type: 2, globalKey: controller.globalKey3)
                    ],
                  ),
                )),
              ],
            ),
          ),
        );
      },
    );
  }
}
